'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: study_data_convert.py
* @Time: 2025/6/15
* @All Rights Reserve By Brtc
'''
"""数据转换的学习"""
# 整数 转字符串  str
int_a = 18
str_b = str(int_a)
print(f"int_a = {int_a}  , type(int_a) = {type(int_a)})")
print(f"strt_b = {str_b}, type(str_b) = {type(str_b)}")


# 浮点数转字符串
float_a = 3.14
str_b = str(float_a)
print(f"float_a = {float_a}, type(float_a) = {type(float_a)}")
print(f"str_b = {str_b}, type(str_b) = {type(str_b)}")

# bool 转字符串
bool_a = True
str_b = str(bool_a)
print(f"bool_a = {bool_a}, type(bool_a) = {type(bool_a)}")
print(f"str_b = {str_b}, type(str_b) = {type(str_b)}")


#str 转整数
int_str = "1314"
int_val = int(int_str)
print(f"int_str = {int_str}, type(int_str) = {type(int_str)}")
print(f"int_val = {int_val}, type(int_val) = {type(int_val)}")


# 浮点数转整数,
## 注意向下取整
float_var= 3.14
int_val = int(float_var)

print(f"float_var = {float_var}, type(float_var) = {type(float_var)}")
print(f"int_val = {int_val}, type(int_val) = {type(int_val)}")